import axios from 'axios';
import instance from '@/util/request';


export function insertArticle(data) {
    return instance.post('/article', data);
}

export function selectAllArticle(params) {
  return instance.get('/article', { 
    params: params
  });
}

export function selectArticleById(id) {
    return instance.get(`/article/${id}`);
}

export function updateArticle(data) {
    return instance.put('/article/updateArticle', data);
}

export function deleteArticle(id) {
    return instance.delete(`/article/${id}`);
}

export function selectAllCategory() {
    return instance.get('/article/selectAllCategory');
}

export function selectAllState() {
    return instance.get('/article/selectAllState');
}